/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 footprint.h

	$Header: /heroes4/footprint.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( FOOTPRINT_H_INCLUDED )
#define FOOTPRINT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "map_point.h"
// ------------------------------------------------------------
// abstract class with footprint information
// ------------------------------------------------------------
class t_footprint
{
public:
	virtual ~t_footprint();

	virtual bool           are_any_cells_flat() const;
	virtual bool           are_any_cells_impassable() const;
	virtual int			   get_vertex_height( t_map_point_2d const& point ) const;
	virtual t_map_point_2d get_size() const = 0;
	virtual bool           is_cell_flat( t_map_point_2d const & point ) const = 0;
	virtual bool           is_cell_impassable( t_map_point_2d const & point ) const = 0;
	bool				   is_edge_blocked( t_map_point_2d const& point,
											bool under_bridge,  bool right_edge ) const;
	virtual bool		   is_left_edge_blocked( t_map_point_2d const& point,
												 bool				   under_bridge ) const;
	virtual bool           is_left_edge_trigger( t_map_point_2d const & point ) const = 0;
	virtual bool		   is_right_edge_blocked( t_map_point_2d const& point,
												  bool					under_bridge ) const;
	virtual bool           is_right_edge_trigger( t_map_point_2d const & point ) const = 0;
	virtual bool           is_trigger_cell( t_map_point_2d const& point ) const = 0;
};

inline bool t_footprint::is_edge_blocked( t_map_point_2d const& point, bool under_bridge,
										  bool right_edge ) const
{
	if (right_edge)
		return is_right_edge_blocked( point, under_bridge );
	return is_left_edge_blocked( point, under_bridge );
}

#endif // FOOTPRINT_H_INCLUDED